WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
wolf::FeatureBase Class Reference

Base class of features: a measurement with its uncertainty, extracted from a capture, with the factors it produces. More...

#include <core/feature/feature_base.h>

Inheritance diagram for wolf::FeatureBase:
[legend]

Public Types

enum  UncertaintyType { UNCERTAINTY_IS_COVARIANCE , UNCERTAINTY_IS_INFO , UNCERTAINTY_IS_STDDEV }
 Type of the measurement uncertainty passed to the constructor. More...
 

Public Member Functions

 FeatureBase (const std::string &_type, const Eigen::VectorXd &_measurement, const Eigen::MatrixXd &_meas_uncertainty, UncertaintyType _uncertainty_type=UNCERTAINTY_IS_COVARIANCE)
 Constructor from the measurement and its uncertainty. More...
 
 ~FeatureBase () override=default
 
virtual void remove (bool viral_remove_parent_without_children=false)
 Removes the feature and its factors. More...
 
bool hasChildren () const override
 Returns whether the node has children in the Wolf tree. More...
 
unsigned int id () const
 Returns the feature id. More...
 
unsigned int trackId () const
 Returns the id of the feature track. More...
 
void setTrackId (unsigned int _tr_id)
 Sets the id of the feature track. More...
 
unsigned int landmarkId () const
 Returns the id of the landmark. More...
 
void setLandmarkId (unsigned int _lmk_id)
 Sets the id of the landmark. More...
 
double getMeasurement (unsigned int _ii) const
 Returns _ii component of measurement vector. More...
 
const Eigen::VectorXd & getMeasurement () const
 Returns the measurement vector. More...
 
const Eigen::MatrixXd & getMeasurementCovariance () const
 Returns the measurement covariance. More...
 
Eigen::MatrixXd getMeasurementInformation () const
 Returns the measurement information matrix. More...
 
const Eigen::MatrixXd & getMeasurementSquareRootInformationUpper () const
 Returns the upper triangular square root of the measurement information matrix. More...
 
const Eigen::VectorXd & getExpectation () const
 Returns the expected measurement. More...
 
void setExpectation (const Eigen::VectorXd &expectation)
 Sets the expected measurement. More...
 
FrameBaseConstPtr getFrame () const
 Returns the frame of the capture the feature belongs to. More...
 
FrameBasePtr getFrame ()
 Returns the frame of the capture the feature belongs to. More...
 
CaptureBaseConstPtr getCapture () const
 Returns the capture the feature belongs to (nullptr if none) More...
 
CaptureBasePtr getCapture ()
 Returns the capture the feature belongs to (nullptr if none) More...
 
FactorBaseConstPtrList getFactorList () const
 Returns the factors of the feature. More...
 
FactorBasePtrList getFactorList ()
 Returns the factors of the feature. More...
 
void getFactorList (FactorBaseConstPtrList &_fac_list) const
 Adds the factors of the feature to a list. More...
 
void getFactorList (FactorBasePtrList &_fac_list)
 Adds the factors of the feature to a list. More...
 
bool hasFactor (FactorBaseConstPtr _fac) const
 Returns whether the factor belongs to the feature. More...
 
void link (CaptureBasePtr cap_ptr)
 Links the feature to a capture. More...
 
virtual void printHeader (int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream, std::string _tabs="") const
 Prints the information of this node (not of its children) More...
 
void print (int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream=std::cout, std::string _tabs="") const
 Prints this node and, depending on the depth, its children. More...
 
virtual CheckLog localCheck (bool _verbose, std::ostream &_stream, std::string _tabs="") const
 Checks the consistency of this node (not of its children) More...
 
bool check (CheckLog &_log, bool _verbose, std::ostream &_stream, std::string _tabs="") const
 Checks the consistency of this node and its children, composing the log. More...
 
- Public Member Functions inherited from wolf::NodeBase
 NodeBase (const std::string &_category, const std::string &_type="Undefined", const std::string &_name="")
 Constructor. More...
 
virtual ~NodeBase ()=default
 Destructor. More...
 
unsigned int nodeId () const
 Returns the node id, unique over the whole Wolf tree. More...
 
std::string getCategory () const
 Returns the category of the node. More...
 
std::string getType () const
 Returns the type (subcategory) of the node. More...
 
std::string getName () const
 Returns the name of the node. More...
 
bool isRemoving () const
 Returns whether the node is being removed. More...
 
virtual bool hasChildren () const =0
 Returns whether the node has children in the Wolf tree. More...
 
void setType (const std::string &_type)
 Sets the type (subcategory) of the node. More...
 
void setName (const std::string &_name)
 Sets the name of the node. More...
 
ProblemConstPtr getProblem () const
 Returns the problem the node belongs to. More...
 
ProblemPtr getProblem ()
 Returns the problem the node belongs to. More...
 

Static Public Member Functions

template<typename classType , typename... T>
static std::shared_ptr< classType > emplace (CaptureBasePtr _cpt_ptr, T &&... all)
 Creates a feature of class classType and links it to the capture. More...
 

Protected Attributes

unsigned int feature_id_
 Feature id, unique among features. More...
 
unsigned int track_id_
 ID of the feature track. More...
 
unsigned int landmark_id_
 ID of the landmark. More...
 
Eigen::VectorXd measurement_
 Measurement vector. More...
 
Eigen::MatrixXd measurement_covariance_
 Measurement covariance matrix. More...
 
Eigen::MatrixXd measurement_sqrt_information_upper_
 Upper square root of the information matrix. More...
 
Eigen::VectorXd expectation_
 Expected measurement. More...
 
- Protected Attributes inherited from wolf::NodeBase
ProblemWPtr problem_ptr_
 Problem the node belongs to. More...
 
unsigned int node_id_
 Node id. It is unique over the whole Wolf Tree. More...
 
std::string node_category_
 Text label identifying the category of node ("SENSOR", "FEATURE", etc) More...
 
std::string node_type_
 Type or subcategory of node (derived class name: "SensorOdom2d", etc) More...
 
std::string node_name_
 
bool is_removing_
 A flag for safely removing nodes from the Wolf tree. See remove(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from wolf::NodeBase
virtual void setProblem (ProblemPtr _prob_ptr)
 Sets the problem the node belongs to. More...
 

Detailed Description

Base class of features: a measurement with its uncertainty, extracted from a capture, with the factors it produces.

Member Enumeration Documentation

◆ UncertaintyType

Type of the measurement uncertainty passed to the constructor.

Enumerator
UNCERTAINTY_IS_COVARIANCE 

Covariance matrix.

UNCERTAINTY_IS_INFO 

Information matrix.

UNCERTAINTY_IS_STDDEV 

Standard deviations (not implemented)

Constructor & Destructor Documentation

◆ FeatureBase()

wolf::FeatureBase::FeatureBase ( const std::string &  _type,
const Eigen::VectorXd &  _measurement,
const Eigen::MatrixXd &  _meas_uncertainty,
UncertaintyType  _uncertainty_type = UNCERTAINTY_IS_COVARIANCE 
)

Constructor from the measurement and its uncertainty.

Parameters
_typederived type name
_measurementthe measurement
_meas_uncertaintythe uncertainty of the measurement (see _uncertainty_type)
_uncertainty_typewhether _meas_uncertainty is a covariance or an information matrix (std dev not implemented)

◆ ~FeatureBase()

wolf::FeatureBase::~FeatureBase ( )
overridedefault

Member Function Documentation

◆ check()

bool wolf::FeatureBase::check ( CheckLog &  _log,
bool  _verbose,
std::ostream &  _stream,
std::string  _tabs = "" 
) const

Checks the consistency of this node and its children, composing the log.

◆ emplace()

template<typename classType , typename... T>
std::shared_ptr< classType > wolf::FeatureBase::emplace ( CaptureBasePtr  _cpt_ptr,
T &&...  all 
)
static

Creates a feature of class classType and links it to the capture.

◆ getCapture() [1/2]

CaptureBasePtr wolf::FeatureBase::getCapture ( )
inline

Returns the capture the feature belongs to (nullptr if none)

◆ getCapture() [2/2]

CaptureBaseConstPtr wolf::FeatureBase::getCapture ( ) const
inline

Returns the capture the feature belongs to (nullptr if none)

◆ getExpectation()

const Eigen::VectorXd & wolf::FeatureBase::getExpectation ( ) const
inline

Returns the expected measurement.

◆ getFactorList() [1/4]

FactorBasePtrList wolf::FeatureBase::getFactorList ( )
inline

Returns the factors of the feature.

◆ getFactorList() [2/4]

FactorBaseConstPtrList wolf::FeatureBase::getFactorList ( ) const
inline

Returns the factors of the feature.

◆ getFactorList() [3/4]

void wolf::FeatureBase::getFactorList ( FactorBaseConstPtrList &  _fac_list) const

Adds the factors of the feature to a list.

◆ getFactorList() [4/4]

void wolf::FeatureBase::getFactorList ( FactorBasePtrList &  _fac_list)

Adds the factors of the feature to a list.

◆ getFrame() [1/2]

FrameBasePtr wolf::FeatureBase::getFrame ( )

Returns the frame of the capture the feature belongs to.

◆ getFrame() [2/2]

FrameBaseConstPtr wolf::FeatureBase::getFrame ( ) const

Returns the frame of the capture the feature belongs to.

◆ getMeasurement() [1/2]

const Eigen::VectorXd & wolf::FeatureBase::getMeasurement ( ) const
inline

Returns the measurement vector.

◆ getMeasurement() [2/2]

double wolf::FeatureBase::getMeasurement ( unsigned int  _ii) const
inline

Returns _ii component of measurement vector.

WARNING: To be fast, it does not check that index _ii is smaller than dimension.

◆ getMeasurementCovariance()

const Eigen::MatrixXd & wolf::FeatureBase::getMeasurementCovariance ( ) const
inline

Returns the measurement covariance.

◆ getMeasurementInformation()

Eigen::MatrixXd wolf::FeatureBase::getMeasurementInformation ( ) const
inline

Returns the measurement information matrix.

◆ getMeasurementSquareRootInformationUpper()

const Eigen::MatrixXd & wolf::FeatureBase::getMeasurementSquareRootInformationUpper ( ) const
inline

Returns the upper triangular square root of the measurement information matrix.

◆ hasChildren()

bool wolf::FeatureBase::hasChildren ( ) const
inlineoverridevirtual

Returns whether the node has children in the Wolf tree.

Implements wolf::NodeBase.

◆ hasFactor()

bool wolf::FeatureBase::hasFactor ( FactorBaseConstPtr  _fac) const

Returns whether the factor belongs to the feature.

◆ id()

unsigned int wolf::FeatureBase::id ( ) const
inline

Returns the feature id.

◆ landmarkId()

unsigned int wolf::FeatureBase::landmarkId ( ) const
inline

Returns the id of the landmark.

◆ link()

void wolf::FeatureBase::link ( CaptureBasePtr  cap_ptr)

Links the feature to a capture.

◆ localCheck()

CheckLog wolf::FeatureBase::localCheck ( bool  _verbose,
std::ostream &  _stream,
std::string  _tabs = "" 
) const
virtual

Checks the consistency of this node (not of its children)

◆ print()

void wolf::FeatureBase::print ( int  depth,
bool  factored_by,
bool  metric,
bool  state_blocks,
std::ostream &  stream = std::cout,
std::string  _tabs = "" 
) const

Prints this node and, depending on the depth, its children.

◆ printHeader()

void wolf::FeatureBase::printHeader ( int  depth,
bool  factored_by,
bool  metric,
bool  state_blocks,
std::ostream &  stream,
std::string  _tabs = "" 
) const
virtual

Prints the information of this node (not of its children)

◆ remove()

void wolf::FeatureBase::remove ( bool  viral_remove_parent_without_children = false)
virtual

Removes the feature and its factors.

Parameters
viral_remove_parent_without_childrenif true, removes the capture if it is left without children

◆ setExpectation()

void wolf::FeatureBase::setExpectation ( const Eigen::VectorXd &  expectation)
inline

Sets the expected measurement.

◆ setLandmarkId()

void wolf::FeatureBase::setLandmarkId ( unsigned int  _lmk_id)
inline

Sets the id of the landmark.

◆ setTrackId()

void wolf::FeatureBase::setTrackId ( unsigned int  _tr_id)
inline

Sets the id of the feature track.

◆ trackId()

unsigned int wolf::FeatureBase::trackId ( ) const
inline

Returns the id of the feature track.

Member Data Documentation

◆ expectation_

Eigen::VectorXd wolf::FeatureBase::expectation_
protected

Expected measurement.

◆ feature_id_

unsigned int wolf::FeatureBase::feature_id_
protected

Feature id, unique among features.

◆ landmark_id_

unsigned int wolf::FeatureBase::landmark_id_
protected

ID of the landmark.

◆ measurement_

Eigen::VectorXd wolf::FeatureBase::measurement_
protected

Measurement vector.

◆ measurement_covariance_

Eigen::MatrixXd wolf::FeatureBase::measurement_covariance_
protected

Measurement covariance matrix.

◆ measurement_sqrt_information_upper_

Eigen::MatrixXd wolf::FeatureBase::measurement_sqrt_information_upper_
protected

Upper square root of the information matrix.

◆ track_id_

unsigned int wolf::FeatureBase::track_id_
protected

ID of the feature track.


The documentation for this class was generated from the following files: